package jsyf.oa.service.wreport;

import com.alibaba.fastjson.JSON;
import jsyf.oa.dao.wreport.WReportCustomerDao;
import jsyf.oa.entity.wreport.WReportCustomerEntity;
import jsyf.oa.facade.wreport.WReportCusFacade;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * Created by Administrator on 2017/12/27 0027.
 */
@Service
@Transactional(rollbackFor = Exception.class)
@com.alibaba.dubbo.config.annotation.Service(protocol = {"dubbo"})
public class WReportCusService implements WReportCusFacade {
    @Autowired
    private WReportCustomerDao dao;

    @Override
    public String save(String jsonData) {
        WReportCustomerEntity model = JSON.toJavaObject(JSON.parseObject(jsonData), WReportCustomerEntity.class);
        dao.add(model);
        return model.getId();
    }
}
